var express = require('express');
var router = express.Router();

router.post('/api/userLogin', function (req, res) {
    var body = req.body; // query | params
    console.log(body)
    if(body && body.data){
        body = body.data;
        if(body.body.qq == 'admin' && body.body.password == '9527'){
            res.status(200).json({
                body:{'token':'sldfjskljfksahfsakf'},
                head:{'errorCode':'200','errorMsg':''}
            })
        }else{
            res.status(500).json({head:{'errorCode':'500','errorMsg':'用户名或密码错误'}})
        }
    }else{
        res.status(500).json({head:{'errorCode':'500','errorMsg':'请求错误'}})
    }
});

module.exports = router;
